package phoenixAAD.WifiFlashDrive;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;

/**
 * The main help page
 */
public class HelpActivity extends Activity implements OnItemClickListener{
	ListView list;
	
	private static final int
		ABOUT = 0,
		APP = 1,
		WINDOWS = 2,
		MAC = 3,
		LINUX = 4,
		TROUBLESHOOT = 5;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.help);
		setTitle(getResources().getString(R.string.help_title));
		list = (ListView) findViewById(R.id.help_list);
		ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, android.R.id.text1, this.getResources().getStringArray(R.array.help_options));
		list.setAdapter(adapter);
		
		list.setOnItemClickListener(this);
		
	}

	public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
		switch(position)
		{
		case ABOUT:
			startActivity(new Intent(this, HelpAboutActivity.class));
			break;
		case APP:
			startActivity(new Intent(this, HelpAppActivity.class));
			break;
		case WINDOWS:
			startActivity(new Intent(this, HelpWindowsActivity.class));
			break;
		case MAC:
			startActivity(new Intent(this, HelpMacActivity.class));
			break;
		case LINUX:
			startActivity(new Intent(this, HelpLinuxActivity.class));
			break;
		case TROUBLESHOOT:
			startActivity(new Intent(this, HelpTroubleActivity.class));
			break;
		}
	}

}
